package com.ctl.function;

import com.ctl.config.JacksonMapper;
import com.ctl.model.User;
import com.ctl.util.StrUtil;

import java.util.function.Consumer;
public class ConsumerTest {
    public static void main(String[] args) {
        Consumer<User> consumer = user -> {
            try {
                System.out.println(StrUtil.formatJson(new JacksonMapper().writeValueAsString(user)));
            } catch (Exception e) {
            }
        };

       consumer.accept(new User());
    }
}
